package com.foreknow.service.impl;

import com.foreknow.dao.UserMapper;
import com.foreknow.entity.User;
import com.foreknow.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public int deleteByPrimaryKey(Integer id) {
        return 0;
    }

    @Override
    public int insert(User record) {
        return 0;
    }

    @Override
    public int insertSelective(User record) {
        return userMapper.insertSelective(record);
    }

    @Override
    public User selectByPrimaryKey(Integer id) {
        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        return userMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(User record) {
        return 0;
    }


    //    @Transactional
    @Override
    public User login(String username, String password) {

        User login = userMapper.login(username,password);
        return login;
    }



    @Override
    public List<User> listUser() {
        List<User> list = userMapper.listUser();
        return list;
    }

    @Override
    public List<User> selectBySS(User user) {
        return userMapper.selectBySS(user);
    }

    @Override
    public int removeUser(User user) {
        return userMapper.removeUser(user);
    }


}
